using UnityEngine;
using System.Collections;

public class AlienDialog : MonoBehaviour {
	public GUISkin mainSkin;
	public string text="";
	public string font="";
	
	public AlienGenome target;
	public float shiftX=0.5f;
	public float shiftY=0.5f;
	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
	}
	
	void OnGUI() {
		//if(target != null && target.gameObject.active) 
		{
			Vector3 worldPoint= this.transform.position;
				worldPoint.y+=shiftY;
				worldPoint.x+=shiftX;
			Vector2 screenCoord= Camera.mainCamera.WorldToViewportPoint (worldPoint);
		
			if(font!="")
				GUI.Label(new Rect(screenCoord.x * (float)Screen.width, (1-screenCoord.y)* (float)Screen.height, 150, 200), text, mainSkin.GetStyle(font));
			else
				GUI.Label(new Rect(screenCoord.x * (float)Screen.width, (1-screenCoord.y)* (float)Screen.height, 150, 200), text);
		}
	}
	
}
